<template>
  <span>
    <template v-if="city_name == 'dt'">
      <p>值班提示</p>
      <p>
        带班领导：<span>{{ zhibanDeatail.leader1 }}</span>
      </p>
      <p>
        值班人员：<span>{{ zhibanDeatail.dutypeople1 }}</span>
      </p>
    </template>
    <template v-if="city_name == 'yc'">
      <span>{{ zhibanDeatail.dutypeople1 }}</span>
      电话 <span>{{ zhibanDeatail.tel }}</span>
    </template>
    <template v-if="city_name == 'sz'">
      <p>值班提示</p>
      <p>
        带班领导：<span>{{ zhibanDeatail.leader1 }}</span
        ><span>{{ zhibanDeatail.leader2 }}</span>
      </p>
      <p>
        值班人员：<span>{{ zhibanDeatail.dutypeople1 }}</span
        ><span>{{ zhibanDeatail.dutypeople2 }}</span>
      </p>
    </template>
  </span>
</template>

<script>
import { getZhiban } from "@/api/front/articleQuery.js";
import { mapState } from "vuex";
export default {
  name: "GetZhiban",

  data() {
    return {
      zhibanDeatail: {},
    };
  },

  components: {},

  computed: {
    ...mapState({
      city_name: (state) => state.user.city_name,
    }),
  },
  mounted() {
    this.getInfo();
  },

  watch: {
    value: {
      handler(val) {},
      deep: true,
      immediate: true,
    },
  },

  methods: {
    getInfo() {
      getZhiban({ siteId: this.$route.query.siteId }).then((res) => {
        console.log(res);
        this.zhibanDeatail = res.data;
      });
    },
  },
};
</script>

<style scoped lang="scss">
p {
  padding: 0;
  margin: 0;
}
</style>
